package com.rinoiot.weather.controller;

import com.alibaba.fastjson.JSON;
import com.rinoiot.weather.entity.Vo.CurrentWeatherVo;
import com.rinoiot.weather.entity.query.WeatherQueryParam;
import com.rinoiot.weather.service.CurrentWeatherService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("weather")
@AllArgsConstructor
public class CurrentWeatherController {

    private CurrentWeatherService currentWeatherService;

    @PostMapping("current")
    public CurrentWeatherVo getCurrentWeather(@RequestBody WeatherQueryParam param) {

        return currentWeatherService.getCurrentWeather(param);
    }

}
